package com.music.authority.dao.impl;

import org.hibernate.SQLQuery;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.music.authority.dao.RePwdDao;

@Repository
public class RePwdDaoImpl implements RePwdDao {

	@Autowired
	SessionFactory sessionFactory;
	@Override
	public void rePwd(String id, String newPwd) {
		String sql="UPDATE T_USER SET PWD=:pwd,MODIFYDATE=SYSDATE,MODIFYNAME='DL.LF' WHERE ID=:id";
		SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);
		query.setParameter("pwd", newPwd);
		query.setParameter("id", id);
		query.executeUpdate();
	}

}
